package com.zofer.study.singleton;

/**
 * @description 枚举获取单例
 * @date: 2020/9/29 15:31
 */
public class EnumSingleton {

    private EnumSingleton(){};

    enum Singleton{
        INSTANCE;

        private EnumSingleton instance = null;

        Singleton(){
            instance = new EnumSingleton();
        }

        public EnumSingleton getInstance(){
            return instance;
        }

    }

    public EnumSingleton getEnumSingleton(){
        return Singleton.INSTANCE.getInstance();
    }
}
